
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.dzxcqmxm.JB.User" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <title>JSP - Hello World</title>
	<style>
		div{
			background-color: #E0FFFF;
			width: 100%;
			height: 600px;
			bottom: 0;
			margin: 0;
		}
		table{
			margin: 0 auto;
			position: absolute;
			height: 300px;
			width: 800px;
		}
		td{
			position: center;
			margin: auto;
			text-align: center;
			line-height: 20px;

		}
	</style>
</head>
<body>
<div>
<form action="/dzxc/findUserByNameServlet" method="post">
	查找用户：UserName: <input type="text" name="UserName"/>
	<%--顾客名: <input type="text" name="cname1"/>
	邮箱: <input type="text" name="email1"/>
	余额: <input type="text" name="balance1"/>--%>
	<button type="submit">按用户名查询用户信息</button>
</form>

-----------------------------------------------------------------------------------------

<form action="/dzxc/indexUserServlet" method="post">
    <h2>用户列表</h2>

    <table border="1">
        <tr><td>用户名</td><td>用户密码</td></tr>
<%
	response.setContentType("text/html;charset=utf-8");
    /*public ArrayList<Customer> findAllCustomer()throws DaoExcepton;*/
    ArrayList<User> userArrayList = (ArrayList<User>) session.getAttribute("userArrayList");
	if (userArrayList!=null&&userArrayList.size()>0){
		for(User user:userArrayList){
			out.println("<tr><td>"+user.getUserName()+"</td>");
			out.println("<td>"+user.getUserPwd()+"</td>");
			out.println("<td><a href='/dzxc/admin/user/updateUser.jsp?UserName="+user.getUserName()+"'>修改密码</a></td>");
			out.println("<td><a href='/dzxc/delUserServlet?UserName="+user.getUserName()+"'>删除用户</a></td></tr>");
		}
	}
%>
<tr>
    <td><button><a href="/dzxc/admin/user/addUser.jsp">新增用户</a></button></td>
</tr>
        </table>
</form>
</div>

</body>
</html>